﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Table.Master" Inherits="System.Web.Mvc.ViewPage<SohuWeb.Models.ConfigModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	系统设置
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>系统设置</h2>
    <p>
        修改系统设置： 
    </p>

    <% using (Html.BeginForm()) { %>
        <%: Html.ValidationSummary(true, "更新设置不成功。请更正错误并重试。") %>
        <div>
            <fieldset>
                <legend>配置内容</legend>
                
                <div class="editor-label">
                    <%: Html.LabelFor(m => m.CSVPath) %>
                </div>
                <div class="editor-field">
                    <%: Html.TextBoxFor(m => m.CSVPath, new { @Value = ViewData["CSVPath"] }) %>
                    <%: Html.ValidationMessageFor(m => m.CSVPath) %>
                </div>
                
                <div class="editor-label">
                    <%: Html.LabelFor(m => m.CSVGatherTimeHour) %>
                </div>
                <div class="editor-field">
                    <select name="CSVGatherTimeHour">
                    <%
                        for (int i = 0; i < 24; i++) {
                            if (Convert.ToInt16(ViewData["CSVGatherTimeHour"]) == i) {
                                Response.Write(string.Format("<option selected value='{0:D2}'>{1:D2}</option>", i, i));
                            } else {
                                Response.Write(string.Format("<option value='{0:D2}'>{1:D2}</option>", i, i));
                            }
                        }
                    %>
                    </select>点
                    <select name="CSVGatherTimeMinute">
                    <%
                        for (int i = 0; i < 60; i+=5) {
                            if (Convert.ToInt16(ViewData["CSVGatherTimeMinute"]) == i) {
                                Response.Write(string.Format("<option selected value='{0:D2}'>{1:D2}</option>", i, i));
                            } else {
                                Response.Write(string.Format("<option value='{0:D2}'>{1:D2}</option>", i, i));
                            }
                        }
                    %>
                    </select>分
                </div>
                
                <div class="editor-label">
                    <%: Html.LabelFor(m => m.NewDataGatherTimeHour) %>
                </div>
                <div class="editor-field">
                    <select name="NewDataGatherTimeHour">
                    <%
                        for (int i = 0; i < 24; i++) {
                            if (Convert.ToInt16(ViewData["NewDataGatherTimeHour"]) == i) {
                                Response.Write(string.Format("<option selected value='{0:D2}'>{1:D2}</option>", i, i));
                            } else {
                                Response.Write(string.Format("<option value='{0:D2}'>{1:D2}</option>", i, i));
                            }
                        }
                    %>
                    </select>点
                    <select name="NewDataGatherTimeMinute">
                    <%
                        for (int i = 0; i < 60; i+=5) {
                            if (Convert.ToInt16(ViewData["NewDataGatherTimeMinute"]) == i) {
                                Response.Write(string.Format("<option selected value='{0:D2}'>{1:D2}</option>", i, i));
                            } else {
                                Response.Write(string.Format("<option value='{0:D2}'>{1:D2}</option>", i, i));
                            }
                        }
                    %>
                    </select>分
                </div>
                
                <div class="editor-label">
                    <%: Html.LabelFor(m => m.ComputeTimeHour) %>
                </div>
                <div class="editor-field">
                    <select name="ComputeTimeHour">
                    <%
                        for (int i = 0; i < 24; i++) {
                            if (Convert.ToInt16(ViewData["ComputeTimeHour"]) == i) {
                                Response.Write(string.Format("<option selected value='{0:D2}'>{1:D2}</option>", i, i));
                            } else {
                                Response.Write(string.Format("<option value='{0:D2}'>{1:D2}</option>", i, i));
                            }
                        }
                    %>
                    </select>点
                    <select name="ComputeTimeMinute">
                    <%
                        for (int i = 0; i < 60; i+=5) {
                            if (Convert.ToInt16(ViewData["ComputeTimeMinute"]) == i) {
                                Response.Write(string.Format("<option selected value='{0:D2}'>{1:D2}</option>", i, i));
                            } else {
                                Response.Write(string.Format("<option value='{0:D2}'>{1:D2}</option>", i, i));
                            }
                        }
                    %>
                    </select>分
                </div>
                
                <p>
                    <input type="submit" value="更改设置" />
                </p>
            </fieldset>
        </div>
    <% } %>
</asp:Content>
